/*----------------------------------------------------------------------
  - File name      : tmt.h
  - Author         : Quark Team
  - Update date    : 2020-12-13                     
  -	Copyright      : Gevico Electronic studio   
  - Module comments: Header file of Task Management Tool module.
-----------------------------------------------------------------------*/
#ifndef __TMT_H_
#define __TMT_H_
/*-----------------------------------------------------------------------
|                                 DATA                                  |
-----------------------------------------------------------------------*/
/*--------------------------------------------------------
| @Description: Task work state                          |
--------------------------------------------------------*/
typedef enum
{
	PRO_CONTINUE = 1,
	PRO_STOP = !PRO_CONTINUE
} PRO_STATE;

/*-----------------------------------------------------------------------
|                                CONFIG                                 |
-----------------------------------------------------------------------*/
/*--------------------------------------------------------
| @Description: Task definition max number               |
--------------------------------------------------------*/

/* The maximum number is 256 */
#define  TASKS_MAX       3

/*--------------------------------------------------------
| @Description: Add timer interrupt control code         |
--------------------------------------------------------*/

#define   NVIC_TIMER_ISR_ENABLE()      ET0 = 1
#define   NVIC_TIMER_ISR_DISABLE()     ET0 = 0

/*-----------------------------------------------------------------------
|                             API FUNCTION                              |
-----------------------------------------------------------------------*/

/*--------------------------------------------------------
| @Description: Task control function                    |
--------------------------------------------------------*/

/* Put into the main program loop */
void TMT_Pro_Handler_Callback(void);   
/* Put into the time interrupt function */
void TMT_Pro_Time_Callback(void);

void TMT_Pro_Create(void (*TaskHook) (void),uint16 TRITime);
void TMT_Pro_Delete(void (*TaskHook) (void));
void TMT_Pro_Time_Ctrl(void (*TaskHook) (void),uint16 TRITime);
void TMT_Pro_Run_Ctrl(void (*TaskHook) (void),PRO_STATE State);

#endif
/*-----------------------------------------------------------------------
|          END OF FLIE        (C) COPYRIGHT Gevico Electronics          | 
-----------------------------------------------------------------------*/

